/*
 * Copyright (c) 2025 Huawei Device Co., Ltd. 2025-2025. ALL rights reserved.
 */

#ifndef AUDIOEDITTESTAPP_AUDIOSUITEERROR_H
#define AUDIOEDITTESTAPP_AUDIOSUITEERROR_H

#include <string>
#include <map>
#include "ohaudio/native_audio_suite_base.h"

// 定义错误码枚举
enum class AudioSuiteResult {
    AUDIOSUITE_SUCCESS = 0,
    AUDIOSUITE_ERROR_INVALID_PARAM = 1,
    AUDIOSUITE_ERROR_ILLEGAL_STATE = 2,
    AUDIOSUITE_ERROR_SYSTEM = 3,
    AUDIOSUITE_ERROR_UNSUPPORTED_FORMAT = 4,
    AUDIOSUITE_ERROR_ENGINE_NOT_EXIST = 5,
    AUDIOSUITE_ERROR_PIPELINE_NOT_EXIST = 6,
    AUDIOSUITE_ERROR_NODE_NOT_EXIST = 7,
    AUDIOSUITE_ERROR_UNSUPPORTED_CONNECT = 8,
    AUDIOSUITE_ERROR_UNSUPPORT_OPERATION = 9,
    AUDIOSUITE_ERROR_CREATED_EXCEED_SYSTEM_LIMITS = 10,
    AUDIOSUITE_ERROR_REQUIRED_PARAMETERS_MISSED = 11,

    DEMO_ERROR_FAILD = 99,
    DEMO_PARAMETER_ANALYSIS_ERROR = 100,
    DEMO_ERROR_PARSEARGUMENT_FAILED = 101,
    DEMO_ERROR_CREATE_SOURCE_FAILED = 102,
    DEMO_ERROR_TRACK_FORMAT_FAILED = 103,
    DEMO_ERROR_GETAUDIOPROPERTIES_FAILED = 104,
    DEMO_ERROR_DEMUXER_FAILED = 105,
    DEMO_UPDATEINPUTNODE_FAILED = 106,
    DEMO_CREATE_NODE_ERROR = 107,
};

// 错误信息映射表
extern const std::map<AudioSuiteResult, std::string> errorMessages;

// 获取错误码对应的错误信息
std::string GetErrorMessage(AudioSuiteResult result);

#endif //AUDIOEDITTESTAPP_AUDIOSUITEERROR_H